/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bean.chart.editors;

import java.awt.Color;
import java.awt.Component;
import java.beans.PropertyEditorSupport;

/**
 *
 * @author sammael
 */
public class ChartColorEditor extends PropertyEditorSupport{

    @Override
    public Component getCustomEditor() {
        //tu ma byc panel do ustawiania
        return new ChartColorEditorPanel(this);
    }

    @Override
    public boolean supportsCustomEditor() {
        return true;
    }

    @Override
    public boolean isPaintable() {
        return false;
    }

    @Override
    public String getAsText() {
        String representation = new String();
        Color[] val = (Color[])getValue();
        if(val!=null){
        for(Color c : val){
            representation += Integer.toHexString(c.getRGB())+", ";
        }
        return representation;
        }else{
            return " ";
        }
    }

    @Override
    public String getJavaInitializationString() {
        return "lol" + getValue();
    }
    
    
    
    
    
    
}
